<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>计算2个数中的最大值和三个数中的最大值</title>
    <script>

        //计算2个数中的最大值
        function MaxNum(num1,num2){

            /*if(num1 > num2){
                return num1;
            }else{
                return num2;
            }*/

            return num1 > num2 ? num1 : num2;
        }
        console.log(MaxNum(2,8));

        //计算三个数中的最大值
        function maxNumT(num1,num2,num3){
            var max = MaxNum(num1,num2);
            return MaxNum(max,num3);
        }
        console.log(maxNumT(4,7,9));
    </script>
</head>
<body>

</body>
</html>